 <!Doctype html>
 <html>
 <head>
 <meta charset="utf-8">
 <title ></title>
 <style>
 
 </style>
 <script>
 function checkAll(){
 var checkAllEle=document.getElementById("checkAll");
 if(checkAllEle.checked==true){
 var checkOnes=document.getElementsByName("checkOne");
 for(var i=0;i<checkOnes.length;i++){
 checkOnes[i].checked=true;
 }
 }else{
 var checkOnes=document.getElementsByName("checkOne");
 for(var i=0;i<checkOnes.length;i++){
 checkOnes[i].checked=false;
 }
 }
 
 }
 </script>
 </head>
 <body>
 <form action="" method="get">
 <table border="1" width="500px" height="300px" align="center">
 
 <tr>
 <td collapse="3"><input type="submit" value="添加"/></td>
 <td><input type="submit" value="删除"/></td>
 </tr>
 
 
 <tr>
 <td><input type="checkbox" onclick="checkAll" id="checkAll"/></td>
 <td>编号</td>
 <td>姓名</td>
 <td>年龄</td>
 </tr>

 
 
 <tr>
 <td><input type="checkbox" name="checkOne"/></td>
 <td>1</td>
 <td>李白</td>
 <td>21</td>
 </tr>
 <tr>
 <td><input type="checkbox" name="checkOne"/></td>
 <td>2</td>
 <td>杜甫</td>
 <td>17</td>
 </tr>
 <tr>
 <td><input type="checkbox" name="checkOne"/></td>
 <td>3</td>
 <td>苏轼</td>
 <td>23</td>
 </tr>
 
 
 </table>
 </form>
 </body>
 </html>